package rickyGame.game
{
	import ricky.game.Actor;
	import ricky.game.action.Act2D;

	import rickyGame.game.action.ActionHelper;
	import rickyGame.game.skill.SkillData;
	
	/**
	 * 建筑物
	 */
	public class Building extends Fighter
	{
		public function Building()
		{
			super();
		}
		
		override public function load(uint:Object):void
		{
			super.load(uint);
			this.name=uint.name;
			this.asType="ground";
			this.ai.init(uint.perception);
		}
		
		/**
		 * 根据等级加载数据
		 */
		override public function loadProperty(level:int):void
		{
			fightPro.level=level;
			fightPro.load(level);//战斗属性
			var sps:Array=data.ability.split(",");//技能
			
			for each(var skillName:String in sps)
				skills.learn(skillName);
				
			skills.learnAttack(data.attack1);
			
//			if(skills.auto.length>0)
//			{
//				var askill:SkillData=skills.auto[0];
//				var auto:Act=new AutoSpellSateAct(this,askill);
//				auto.animProperty="stand";
////				auto.begin();
//				this.addAct(defaultAct);
//				ActionHelper.inst.addAct(auto);
//				this.stateNames.push(auto);
//			}
//			AutoSpellSateAct
		}

	}
}